#pragma once
#include "Dao.h"
#include "RecordLogic.h"

class CFieldLogic{
public:
	CFieldLogic(void);
	~CFieldLogic(void);

	void SetDao(CDao *pDao);
	void SetRecordLogic(CRecordLogic *pRecordLogic);
	bool ShowFields(CString strDBName,CString strTableName,vector<CFieldEntity> *pFieldList);
	bool AddField(CString strDBName, CString strTableName, vector<CFieldEntity> *pFieldList, CFieldEntity *pFieldEntity);
	bool EditField(CString strDBName, CString strTableName, vector<CFieldEntity> *pFieldList, CString strFieldName, _In_ CFieldEntity *pFieldEntity);
	bool DeleteField(CString strDBName, CString strTableName, vector<CFieldEntity> *pFieldList, CString strFieldName);
	bool CheckIntegrity(CString strDBName, CString strTableName, vector<CFieldEntity> *pFieldList);
	int GetLastError();
	
private:
	CDao *m_pDao;
	int m_nLastError;
	CRecordLogic *m_pRecordLogic;
};

